Version 1.0.1 - last updated 2021-06-16

It's worth mentioning before anyone starts building anything that the Flora
network uses the 433 MHz LoRa parts-- several reasons: it's in an Amateur Radio
frequency band that I have gear like antenna analyzers for, and someone can
just grab a UHF TV Yagi antenna when higher-gain is needed. (The 922 People
would also have expectations of full internet gatewaying for spamming MQTT..)

Hardware for the KISS TNCs have been made from clone Arduino Nanos, Uno, and
Mini Pros, with the LoRa modules being DFRobot's "Firebeetle" SX1278 breakouts
(they're dumb no-MCU boards that're relatively cheap). There's no reason to
think the bare RFM95W modules wouldn't do either, and going the other way,
there's all-in-one atmega|esp+lora boards out there which can skip all this
completely...

While the ESPs are more powerful, they require more power. The remote solar
powered LoRa Digipeaters the Flora project uses have Arduino Mini Pros burning
through a whole 20mA, while the ESP8266 have a start-up surge of ~300mA. (There
isn't much call for digis left in remote areas to have WiFi either.)

When using an MCU at 5V, there has to be voltage level converters for all the
signal lines involving the 3.3v LoRa module. While there are FET-based modules
for that, a simple way is to use resistor voltage dividers. (I suggest blocking
anyone who pretends they're a Highly Experienced Engineer saying how FETs would
be better..)

[Warning: ASCII diagrams and tables ahead. Do no procede further until you're
viewing this in a monospace font]

         2k          1k
GND|---/\/\/\/--+--/\/\/\/---> to Arduino pin
                |
                |
                v
          to 3.3V SX1276 pin


** MCU to SX1278 connections

Signal             |DIO0 |/RST  |CS    |MOSI  |MISO  |SCLK  |VCC |GND

Arduinos           |D2   |D9    |D10   |D11   |D12   |D13   |3.3 |GND
LoLin "NodeMCU v3" |D1   |D0    |D8    |D7    |D6    |D5    |3   |G
Random ESP8266s    |GPIO5|GPIO16|GPIO15|GPIO13|GPIO12|GPIO14|VCC |GND


** SX1278 breakout connections

Signal             |DIO0 |/RST  |CS    |MOSI  |MISO  |SCLK  |VCC |GND

RFM95W (untested)  |"    |RESET |NSS   |"     |"     |SCK   |3.3V|GND +antenna!
DFRobot Firebeetle |D3   |D2    |D4    |"     |"     |SCK   |3V3 |GND

The DFRoboto Firebeetle LoRa breakout boards that the first hardware used had a
small patching area for routing the SX1276 signals to pins with a choice of
D2/D3/D4/D5. If you want to do it differently, there's a second patching area
to bring the others through. (You could put level-converting resistors there
too..)


*** Repeating myself...

* The wiring list of a 5V MCU

A bit messy.. obviously try to get a 3.3v MCU if you can.

/RESET -> Firebeetle D2 (w/ patch) -> 'middle' of a resistor network -> top of
resistor network -> D9 on Arduino

Chip Select -> Firebeetle D4 (w/ patch) -> 'middle' of a resistor network ->
top of resistor network -> D10 on Arduino

DIO0 -> Firebeetle D3 (w/ patch) -> 'middle' of a resistor network -> top of
resistor network -> D2 on Arduino

MOSI -> Firebeetle MOSI (from breakout pin) -> 'middle' of a resistor network
-> top of resistor network -> D11 on Arduino

MISO -> Firebeetle MISO (breakout pin) -> 'middle' of a resistor network -> top
of resistor network -> D12 on Arduino

SCLK -> Firebeetle CSK (breakout pin) -> 'middle' of a resistor network -> top
of resistor network -> D10 on Arduino

Firebeetle's 3V3 -> 3.3V on Arduino

Firebeetle's GND (any one, they're all connected) -> any GND on the Arduino


* The instructions for 3.3V MCUs

For an Arduino Mini Pro.. (Which is really a 5V part, but has been working
reliably at 3.3 for me.)

/RESET -> Firebeetle D2 (w/ patch) -> Arduino's D9
CS -> Firebeetle D4 (w/ patch) -> D10
DIO0 -> Firebeetle D3 (w/ patch) -> D2
MOSI -> Firebeetle MOSI (from breakout pin) -> D11
MISO -> Firebeetle MISO (breakout pin) -> D12
SCLK -> Firebeetle CSK (breakout pin) -> D10
Firebeetle's 3V3 -> 3.3v
Firebeetle's GND -> GND

For a LoLin ESP8266 NodeMCU clone:

/RESET (patched to breakout's D2) -> LoLin's D0 
CS (patched to D4) -> D8
DIO0 (patched to D3) -> D1
MOSI -> D7
MISO -> D6
SCLK -> D5 
3V3 -> "3" (the LoLin's regulator powers the LoRa)
GND -> G

The LoLin's regulator is an AMS1117 that can handle up to 15V, through either
the MCU's Vin or the USB port-- great for Solar powering!

-- 
Chris,,
